import { createApp } from 'vue'
// import { createPinia } from 'pinia'
import piniaStore from './stores/index'
// import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' //全局导入elementPlus样式文件
import 'prismjs/themes/prism.css' //引入代码高亮库样式
// import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from './router'

import './assets/main.css'
import '@amap/amap-jsapi-types' //引入高德ts类型

import components from './components/index'
import { initDB } from '@/utils/tool'

initDB() //初始化indexDb数据库

const app = createApp(App)

// 完整注册ElementPlus组件
// app.use(ElementPlus)

// 完整注册ElementPlusIcon组件
// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//   app.component(key, component)
// }

// pinia store注册
// app.use(createPinia())
app.use(piniaStore)
// 路由注册
app.use(router)
// 全局组件注册
app.use(components)
app.mount('#app')
